feat: add seekStart/seekFinished API, restart(), and onRestart callback#195
Merged
Merged
Conversation
- Fix seek at beginning of slider drag (#134): remove implicit seekTo from sliderPos setter on Android and Windows - Add seekStart()/seekFinished() for clean slider interactions - Fix play() from ended state on Android (STATE_ENDED) and iOS (#82) - Add restart() method to reliably restart from any state - Add onRestart callback fired when loop=true and video restarts - Handle loop manually on web instead of native HTML5 loop to support onRestart detection - Update README with new seek API and playback callbacks documentation
Remove aggressive near-end snapping (10% threshold) that caused the slider to jump to 100% too early. Reduce update throttle from 1s to 250ms for smoother progress tracking.
Add userDragging as LaunchedEffect key so the seek triggers when the drag ends, not only when sliderPos changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
seekTofromsliderPossetter on Android and Windows.play()now works correctly from ended state on Android (STATE_ENDED) and iOS. Addedrestart()method for reliable restart from any state.seekStart()/seekFinished()API — Clean slider interaction without exposinguserDragginginternals. Replaces the error-prone manual pattern.onRestartcallback — Fires whenloop=trueand the video restarts from the beginning. Implemented across all platforms (Android, iOS, macOS, Linux, Windows, Web).loopwith manual handling to supportonRestartcallback detection.restart(),onRestart, andonPlaybackEnded.Test plan
seekStart()/seekFinished()works correctly with ComposeSliderseekTo()still works for programmatic seekingrestart()works after video has ended (sliderPos == 1000f)onRestartfires on each loop iteration withloop = trueonPlaybackEndedstill fires whenloop = false